import { request } from '@/api/auth';
import { da } from 'element-plus/es/locales.mjs';



export const login = (data: {}) => {
  return request.post('/user/login', data);
};

export const feishuLogin = (data: { code: string }) => {
  return request.post('/user/feishu/login', data)
}

export interface PaginationParams {
  page: number;
  size: number;
}
export const listUser = (params: PaginationParams) => {
  return request.get('/user/list', { params });
}

export const getUser = (id: string) => {
  return request.get(`/user/${id}`);
}

export const addUser = (data: { username: string, email: string }) => {
  return request.post('/user/create', data);
}

export const deleteUser = (id: string) => {
  return request.delete(`/user/${id}`);
}

export const disableUser = (data: {}) => {
  return request.post("/user/disable", data)
}

export const updateUser = (id: string, data: { username: string, email: string }) => {
  return request.put(`/user/${id}/update`, data);
}

export const listUserBindGroup = (id: number, query: {}) => {
  return request.get(`/user/${id}/bindgroup/list`, { params: query })
}

export const userBindGroup = (data: {}) => {
  return request.post(`/user/bindgroup`, data)
}

